home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / glutessvertex.z / glutessvertex
Encoding:
Text File  |  2002-10-03  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx((((3333GGGG))))              OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee              gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx - specify a vertex on a polygon
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx( GLUtesselator* _t_e_s_s,
  14.                          GLdouble *_l_o_c_a_t_i_o_n,
  15.                          GLvoid* _d_a_t_a )
  16.  
  17.  
  18. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  19.      _t_e_s_s      Specifies the tessellation object (created with gggglllluuuuNNNNeeeewwwwTTTTeeeessssssss).
  20.  
  21.      _l_o_c_a_t_i_o_n  Specifies the location of the vertex.
  22.  
  23.      _d_a_t_a      Specifies an opaque pointer passed back to the program with the
  24.                vertex callback (as specified by gggglllluuuuTTTTeeeessssssssCCCCaaaallllllllbbbbaaaacccckkkk).
  25.  
  26. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.      gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx describes a vertex on a polygon that the program defines.
  28.      Successive gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx calls describe a closed contour. For example, to
  29.      describe a quadrilateral gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx should be called four times.
  30.      gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx can only be called between gggglllluuuuTTTTeeeessssssssBBBBeeeeggggiiiinnnnCCCCoooonnnnttttoooouuuurrrr and
  31.      gggglllluuuuTTTTeeeessssssssEEEEnnnnddddCCCCoooonnnnttttoooouuuurrrr.
  32.  
  33.      _d_a_t_a normally points to a structure containing the vertex location, as
  34.      well as other per-vertex attributes such as color and normal.  This
  35.      pointer is passed back to the user through the GGGGLLLLUUUU____TTTTEEEESSSSSSSS____VVVVEEEERRRRTTTTEEEEXXXX or
  36.      GGGGLLLLUUUU____TTTTEEEESSSSSSSS____VVVVEEEERRRRTTTTEEEEXXXX____DDDDAAAATTTTAAAA callback after tessellation (see the gggglllluuuuTTTTeeeessssssssCCCCaaaallllllllbbbbaaaacccckkkk
  37.      reference page).
  38.  
  39. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  40.      A quadrilateral with a triangular hole in it can be described as follows:
  41.  
  42.  
  43.           gluTessBeginPolygon(tobj, NULL);
  44.            gluTessBeginContour(tobj);
  45.              gluTessVertex(tobj, v1, v1);
  46.              gluTessVertex(tobj, v2, v2);
  47.              gluTessVertex(tobj, v3, v3);
  48.              gluTessVertex(tobj, v4, v4);
  49.            gluTessEndContour(tobj);
  50.            gluTessBeginContour(tobj);
  51.              gluTessVertex(tobj, v5, v5);
  52.              gluTessVertex(tobj, v6, v6);
  53.              gluTessVertex(tobj, v7, v7);
  54.            gluTessEndContour(tobj);
  55.           gluTessEndPolygon(tobj);
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx((((3333GGGG))))              OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee              gggglllluuuuTTTTeeeessssssssVVVVeeeerrrrtttteeeexxxx((((3333GGGG))))
  71.  
  72.  
  73.  
  74. NNNNOOOOTTTTEEEESSSS
  75.      It is a common error to use a local variable for _l_o_c_a_t_i_o_n or _d_a_t_a and
  76.      store values into it as part of a loop.  For example:
  77.  
  78.           for (i = 0; i < NVERTICES; ++i) {
  79.             GLdouble data[3];
  80.             data[0] = vertex[i][0];
  81.             data[1] = vertex[i][1];
  82.             data[2] = vertex[i][2];
  83.             gluTessVertex(tobj, data, data);
  84.             }
  85.  
  86.  
  87.      This doesn't work.  Because the pointers specified by _l_o_c_a_t_i_o_n and _d_a_t_a
  88.      might not be dereferenced until gggglllluuuuTTTTeeeessssssssEEEEnnnnddddPPPPoooollllyyyyggggoooonnnn is executed, all the
  89.      vertex coordinates but the very last set could be overwritten before
  90.      tessellation begins.
  91.  
  92.      Two common symptoms of this problem are consists of a single point (when
  93.      a local variable is used for _d_a_t_a) and a GGGGLLLLUUUU____TTTTEEEESSSSSSSS____NNNNEEEEEEEEDDDD____CCCCOOOOMMMMBBBBIIIINNNNEEEE____CCCCAAAALLLLLLLLBBBBAAAACCCCKKKK
  94.      error (when a local variable is used for _l_o_c_a_t_i_o_n).
  95.  
  96. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  97.      gggglllluuuuTTTTeeeessssssssBBBBeeeeggggiiiinnnnPPPPoooollllyyyyggggoooonnnn, gggglllluuuuNNNNeeeewwwwTTTTeeeessssssss, gggglllluuuuTTTTeeeessssssssBBBBeeeeggggiiiinnnnCCCCoooonnnnttttoooouuuurrrr, gggglllluuuuTTTTeeeessssssssCCCCaaaallllllllbbbbaaaacccckkkk,
  98.      gggglllluuuuTTTTeeeessssssssPPPPrrrrooooppppeeeerrrrttttyyyy, gggglllluuuuTTTTeeeessssssssNNNNoooorrrrmmmmaaaallll, gggglllluuuuTTTTeeeessssssssEEEEnnnnddddPPPPoooollllyyyyggggoooonnnn
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.